package com.example.models;

import com.example.models.enteties.Topic;
import com.example.models.enteties.User;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: dlernatovich
 * Date: 7/12/12
 * Time: 5:01 PM
 * To change this template use File | Settings | File Templates.
 */
public class UserSingleton {

    private static UserSingleton instance = null;
    private User user;
    private List<Topic> topics;

    private UserSingleton() {
        user = new User();
        topics = new ArrayList<Topic>();
    }

    public static UserSingleton getInstance() {
        if (instance == null) {
            instance = new UserSingleton();
        }
        return instance;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public void clearUser() {
        user = new User();
    }

    public List<Topic> getTopics() {
        return topics;
    }

    public void setTopics(List<Topic> topics) {
        this.topics = topics;
    }
}
